package com.suty.craw.core;

import com.suty.craw.core.impl.*;
import java.net.*;
import java.io.*;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Spider spider = new SpiderImpl();
		Request req = new RequestImpl();
		try {
			req.setUrl(new URL("http://www.xinhuanet.com/"));
			spider.setRequest(req);
			if (spider.Craw()) {
				Response response = spider.getResponse();
				ByteArrayOutputStream bs = response.getPage();
				
				Analyser analyser = new AnalyserImpl();
				analyser.parsePage(bs);
			}
		}
		catch(Exception ex){
			ex.printStackTrace();
		}
	}

}
